package com.chookss.tiku

import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProviders
import com.chookss.tiku.entity.Subject
import kotlinx.android.synthetic.main.activity_practice_test_base.*
import org.jetbrains.anko.textColor

/**
 * Company:
 * Project:
 * Author: liuhaoge
 * Date: 2021/1/5 13:55
 * Note:
 */
 class SearchSubjectDetailActivity: BasePracticeTestActivity<OneSubjectViewModel>() {
    override fun createViewModel(): OneSubjectViewModel {
        return ViewModelProviders.of(this).get(OneSubjectViewModel::class.java).apply {
            subject =  intent?.getSerializableExtra("subject") as Subject
        }
    }

    override fun initData() {
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var subjects= intent?.getSerializableExtra("subject") as Subject
        tvActivityTitle.text = "题目"
        topBar.visibility = View.VISIBLE
        tvTopBarRight.visibility = View.GONE
        tvTopBarLeft.text="题目编号："+subjects.subjectCode
        subjectView().showSubjectNext=3
        tvTopBarLeft.textColor= Color.parseColor("#666666")
        llFloatBtns.visibility = View.VISIBLE
        tvError.visibility = View.VISIBLE
        tvCollect.visibility = View.VISIBLE
        tvShare.visibility = View.VISIBLE

    }

    override fun onShowSubjectsLoaded(isShowData: Boolean) {
        submitMyAnswer(true)
    }
    override fun onSubjectLoaded(index: Int, subject: Subject) {
        super.onSubjectLoaded(index, subject)
//        subjectView().showRightAnswerInfo(false)
    }

}